package controllers


type ReCode int64

const (
	CodeSuccess ReCode = iota*1000
	CodeInvalidParam
	CodeShortExites
	CodeServerBusy
	CodeOriginalUrlGet
)

var codeMsgMap = map[ReCode]string{
	CodeSuccess:"创建短链成功",
	CodeInvalidParam:"请求参数错误",
	CodeShortExites:"短链已经存在",
	CodeServerBusy:  "服务器繁忙",

	CodeOriginalUrlGet:"原链接获取失败",
}

func (c ReCode) GetCodeMsg() string{
	msg, ok := codeMsgMap[c]
	if !ok{
		msg = codeMsgMap[CodeServerBusy]
	}
	return msg
}